<pre class="docs-method-signature"><code>polyline.tangentAt(ratio)</code></pre>
<p>Return a line tangent to the polyline at point that lies <code>ratio</code> (normalized length) away from the beginning of the polyline.</p>

<p>The function expects <code>ratio</code> to lie between 0 and 1; values outside the range are constrained to 0 and 1, respectively.</p>

<p>The tangent line starts at the point at <code>ratio</code>. The direction from <code>start</code> to <code>end</code> is the same as the direction of the polyline segment at the specified point. If the specified point is a point of discontinuity (e.g. it is a point shared by two polyline segments with different slopes), the tangent line is constructed for the earlier segment (i.e. the segment closer to the beginning of the polyline).</p>

<p>The algorithm ignores polyline segments that have zero length. If the polyline contains no valid segments (i.e. all polyline points are coincident), <code>null</code> is returned. If the polyline has fewer than two points (exclusive), <code>null</code> is returned, as well. The <code>polyline.isDifferentiable()</code> <a href="#g.Polyline.prototype.isDifferentiable">function</a> may be used in advance to determine whether the polyline contains at least one valid segment for wich a tangent may be found.</p>
